﻿
namespace Miao
{
    public class Singleton<T> where T : class, new() //单例制造类
    {
        private static T instance;

        public static T Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new T();
                }
                return instance;
            }
        }
        public static void Clear()
        {
            instance = null;
        }
    }
}
